
package vip.xiaonuo.biz.modular.lancerGoodskill.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;
import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
import vip.xiaonuo.biz.modular.lancerCoupon.entity.BizCoupon;
import vip.xiaonuo.biz.modular.lancerGoodskill.entity.BizGoodsKill;
import vip.xiaonuo.biz.modular.lancerGoodskill.param.BizGoodsKillAddParam;
import vip.xiaonuo.biz.modular.lancerGoodskill.param.BizGoodsKillEditParam;
import vip.xiaonuo.biz.modular.lancerGoodskill.param.BizGoodsKillIdParam;
import vip.xiaonuo.biz.modular.lancerGoodskill.param.BizGoodsKillPageParam;
import vip.xiaonuo.biz.modular.pojo.vo.ClientGoodsKillVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 秒杀Service接口
 *
 * @author Lancer
 * @date  2024/03/03 17:01
 **/
public interface BizGoodsKillService extends IService<BizGoodsKill> {

    /**
     * 获取秒杀分页
     *
     * @author Lancer
     * @date  2024/03/03 17:01
     */
    Page<BizGoodsKill> page(BizGoodsKillPageParam bizGoodsKillPageParam);

    /**
     * 添加秒杀
     *
     * @author Lancer
     * @date  2024/03/03 17:01
     */
    void add(BizGoodsKillAddParam bizGoodsKillAddParam);

    @Transactional(rollbackFor = Exception.class)
    void addBus(BizGoodsKillAddParam bizGoodsKillAddParam);

    /**
     * 编辑秒杀
     *
     * @author Lancer
     * @date  2024/03/03 17:01
     */
    void edit(BizGoodsKillEditParam bizGoodsKillEditParam);

    @Transactional(rollbackFor = Exception.class)
    void editBus(BizGoodsKillEditParam bizGoodsKillEditParam);

    /**
     * 删除秒杀
     *
     * @author Lancer
     * @date  2024/03/03 17:01
     */
    void delete(List<BizGoodsKillIdParam> bizGoodsKillIdParamList);

    /**
     * 获取秒杀详情
     *
     * @author Lancer
     * @date  2024/03/03 17:01
     */
    BizGoodsKill detail(BizGoodsKillIdParam bizGoodsKillIdParam);

    /**
     * 获取秒杀详情
     *
     * @author Lancer
     * @date  2024/03/03 17:01
     **/
    BizGoodsKill queryEntity(String id);

    Page<ClientGoodsKillVO> pageClient(BizGoodsKillPageParam bizGoodsKillPageParam);

    Page<ClientGoodsKillVO> doingKill();

    boolean isDoingKill(String id);

    void redGoodsNumberByBoxId(String id);
    void incGoodsNumberByBoxId(String id);

    List<BizGoodsKill> getAllSkillInfo();

    Page<BizGoodsKill> pageBus(BizGoodsKillPageParam bizGoodsKillPageParam);


    void killGoods(String id, HttpServletResponse httpResponse);
}
